package com.tangrong.filesystem.visitor;

import com.tangrong.filesystem.Directory;
import com.tangrong.filesystem.FileLeaf;
import com.tangrong.filesystem.File;

public class CatVisitor implements Visitor {
	
	private static final Visitor visitor = new CatVisitor();
	
	private CatVisitor(){
		
	}
	
	public static Visitor getInstance(){
		return visitor;
	}
	
	@Override
	public void visit(Directory dir) {
		System.out.println("Directory " + dir.getName() + ":");
	/*	for(Node node : dir.getNodes() ){
			node.accept(this);
		}
		System.out.println("Directory " + dir.getName() + " end!"); */
	}

	@Override
	public void visit(FileLeaf file) {
		System.out.println("file " + file.getName() + " ;");
	}

}
